<template>
    <el-container style="height: 500px">
  <el-aside width="200px" style="background-color: #545c64">
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b" accordion>
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-s-custom"></i>
            <span>管理员管理</span>
          </template>
          <el-menu-item-group :span="4">
            <template slot="title">管理员列表</template>
            <el-menu-item index="1-1" @click="sysadmin">系统管理员列表</el-menu-item>
            <el-menu-item index="1-2" @click="librarianAdmin">图书管理员列表</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="管理员日志">
            <el-menu-item index="1-3" @click="librarianAdminLog">图书管理员日志</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
          <el-menu-item @click="User">
            <i class="el-icon-user-solid" ></i>
            <span slot="title">用户信息管理</span>
          </el-menu-item>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-document"></i>
            <span>图书列表管理</span>
          </template>
          <el-menu-item-group :span="4">
            <template slot="title">书籍列表</template>
            <el-menu-item index="3-1" @click="bookCat">图书分类列表</el-menu-item>
            <el-menu-item index="3-2" @click="book">图书信息列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>

    </el-menu>
  </el-aside>

  <el-container>
    <el-header>
      <el-menu
        :default-active="activeIndex2"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
        width=100%>
        <el-menu-item index="1">处理中心</el-menu-item>
        <el-menu-item index="3">消息中心</el-menu-item>
        <el-menu-item index="4">订单管理</a></el-menu-item>
      </el-menu>
    </el-header>

    <el-main>
       <router-view></router-view>
    </el-main>
  </el-container>
</el-container>

</template>

<script>
  export default {
       data() {
            return {
              activeIndex2: '1',
              fits: ['cover'],
              url: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201802%2F01%2F20180201112812_C8F5Z.png&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1635143425&t=c930628696492b5f5f9a2c4a42d3b24c'
            };
          },
      methods: {
        sysadmin() {
               this.$router.push("/systemAdmin").catch(err =>
                    console.log("重复点击")
               )
        },
        handleOpen(key, keyPath) {
                console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
          console.log(key, keyPath);
        },
         handleSelect(key, keyPath) {
          console.log(key, keyPath);
        },
        User(){
          this.$router.push("/user")
        },
        librarianAdmin(){
          this.$router.push("/librarianAdmin")
        },
        bookCat(){
          this.$router.push("/bookCat")
        },
        book(){
          this.$router.push("/book")
        },
        librarianAdminLog(){
          this.$router.push("/log")
        }
      }
    }

</script>

<style>
   .el-header {
      background-color: #545c64;
      color: #333;
    }

    .el-aside {
      color: #333;
    }
    .color {
      background-image: url(../static/beijing.jpg);
      background-size: cover;
    }
</style>
